package com.dxy.user.controller;

import com.dxy.common.pojo.Role;
import com.dxy.common.vo.Result;
import com.dxy.user.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class RoleController {

    @Autowired
    private RoleService roleService;

    @GetMapping("/findUserRole/{userId}")
    public Result<List<Role>> findUserRole(@PathVariable("userId") Integer userId) {
        List<Role> roleList = roleService.findUserRole(userId);
        return Result.ok(roleList);
    }
}
